--
module("UI.Windows.NewGameTextNoticeWin",package.seeall)

local UIUtility = require("UI.Utility")
local UIWindow = require("UI.UIWindow").UIWindow

NewGameTextNoticeWin = UIWindow:new()

NewGameTextNoticeWin.name = "NewGameTextNoticeWin" 


function NewGameTextNoticeWin:Init()
    local t = self.Container.transform
    self.MsgLabel = UIUtility.FindContorl('UILabel',"MsgLabel",t)
end

 
function NewGameTextNoticeWin:SetMsgInfo(text)
    -- 清除之前的动画
    if self.currentTween then
        self.currentTween:Kill()
        self.currentTween = nil
    end
    
    self.MsgLabel.gameObject.transform.localPosition = Vector3(0,0,0)
    self.MsgLabel.text = text
	
    local DOTweenMgr = require("UI.DOTweenMgr")
	function callback_CompleteTextNotice()	
        self:Close(2)
	end

	function callback_StartTextNotice()
        
	end

	self.currentTween = DOTweenMgr.DTDOMove(
			self.MsgLabel.transform,
			self.MsgLabel.transform.localPosition+Vector3(0,40,0),
			2,
			1,
			true,
			callback_StartTextNotice,
			callback_CompleteTextNotice,
			0)
end

function NewGameTextNoticeWin:OnClose()
    self:Reset()
end



function NewGameTextNoticeWin:Reset()
    self.MsgLabel.text = ""
end
